Use g_slice_dup
authorMatthias Clasen <mclasen@redhat.com>
Sun, 8 Jan 2012 00:00:47 +0000 (19:00 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 8 Jan 2012 00:00:47 +0000 (19:00 -0500)
This saves some manual copying.
Pointed out in bug 667473.

gdk/gdkrgba.c

index f5e20c5f3aeb7d46b860c7d1d666de6054c382ee..a9008503953eadc76ead7c510b71fb2db4f166a7 100644 (file)
@@ -71,15 +71,7 @@ G_DEFINE_BOXED_TYPE (GdkRGBA, gdk_rgba,
 GdkRGBA *
 gdk_rgba_copy (const GdkRGBA *rgba)
 {
-  GdkRGBA *copy;
-
-  copy = g_slice_new (GdkRGBA);
-  copy->red = rgba->red;
-  copy->green = rgba->green;
-  copy->blue = rgba->blue;
-  copy->alpha = rgba->alpha;
-
-  return copy;
+  return g_slice_dup (GdkRGBA, rgba);
 }
 
 /**